<?
//print_r($_SERVER);
ob_start(); 
include("common/header.html");
include("common/left.html");
$out_html=ob_get_contents();
ob_end_clean();
$conf = array();
$sql="SELECT * FROM `pft_member_domain_info` WHERE fid={$_SESSION['sid']} LIMIT 1";
$GLOBALS['le']->query($sql);
$conf = $GLOBALS['le']->fetch_assoc();
if($_REQUEST['act']=="download2"){//下载图片   
    $code_img = 'http://qr.liantu.com/api.php?text='.'http://'.$_SESSION['account'].'.12301.cc/wx/html/productlist.html';
	$file=file_get_contents($code_img);
	header('Content-type: image/jpeg'); 
    if ($conf['M_name']) {
        $name = $conf['M_name']."的二维码";
    } else {
        $name = $_SESSION['account']."的二维码";
    }
	// $name=$conf['M_name']."的二维码";
    $name = urlencode($name);
	header("Content-Disposition:attachment;filename=$name.jpeg");
	echo $file;
	exit;
}
echo $out_html;
?>
<link rel="stylesheet" href="css/aliceui.min.css"/>
<link rel="stylesheet" href="css/resetui.css"/>
<link rel="stylesheet" href="css/prod_store.css"/>
<style>
span.domain_url{float: left;width: 170px;padding-top: 6px;text-align: center;font-size: 14px;}
span.domain_url_title{float: left;padding-top: 8px; color: #B2B2B2;text-align: center;font-size: 12px;}
.w_input_ww {background-color: #fff;padding: 5px;border: 1px solid #e5e5e5;height: 20px;width: 110px;line-height:20px;}
.conmb_ma{width: 140px;position: relative;top: -830px;text-align: center;float: right;margin-right: 23px;}
.conmb_ma img{width:140px;height:140px;}
</style>
<div class="wrapper">
<h3 class="mc_title"><span class="mctit_1"><span class="mctit_2">B2C店铺配置</span></span></h3>
<div id="sceneryBox" class="ui-box mt10 fn-clear">
<div class="ui-box-container">
    <div class="ui-box-content">
    <form id="mainForm" class="ui-form" method="post" action="domainConf.php" enctype="multipart/form-data" target="hideFrame">
    <input type="hidden" name="action" value="save"/>
    <input type="hidden" name="upload_mth" value="" id="upload_mth"/>
    <fieldset>
        <div class="ui-form-item">
            <label class="ui-label">
                <span class="ui-form-required">*</span>默认网店域名
            </label>

           
            <span class="domain_url"><a target="_blank" href="http://<?=$_SESSION['account']?>.12301.cc"><?=$_SESSION['account']?>.12301.cc</a></span>
			<span class="domain_url_title">可通过PC电脑，手机浏览器访问</span>
        </div>
		<div class="ui-form-item">
            <label class="ui-label">
                <span class="ui-form-required"></span>自定义域名
            </label>
            <input title="请填写" class="baseInp w_input_ww" data-required="2" name="SLD" type="text" autofocus value="<?=$conf['M_domain']?>">
            <span class="tipTxt">.12301.cc</span>
            
			<span class="ui-form-other ui-form-explain">5~11位，例：12345 ，maipiao等</span>
        </div>
        <!-- <div class="ui-form-item">
            <label class="ui-label">
                <span class="ui-form-required"></span>自主独立域名
            </label>
			<input title="请填写" class="w_input  w408" data-required="2" name="alone_domain" type="text" autofocus value="<?=$conf['M_host']?>">
            <!--<input title="请填写" class="w_input" name="web_name" type="text" autofocus value="">
            <span class="ui-form-other ui-form-explain">提交您的域名申请绑定</span>
        </div> -->
		
        <div class="ui-form-item">
            <label class="ui-label">
                <span class="ui-form-required">*</span>网站名称
            </label>
            <input title="请填写" class="baseInp w_input" name="web_name" type="text" autofocus value="<?=$conf['M_name']?>">
            <span class="ui-form-other ui-form-explain">3~11个字  例：买票网 等</span>
        </div>
        
		<div class="ui-form-item">
            <label class="ui-label">
                <span class="ui-form-required"></span>服务QQ
            </label>
            <input title="请填写" class="baseInp w_input  w408" data-required="2" name="server_qq" type="text" autofocus value="<?=$conf['M_qq']?>">
            <span class="ui-form-other ui-form-explain">请认真填写</span>
        </div>
        <div class="ui-form-item">
            <label class="ui-label">
                <span class="ui-form-required"></span>服务电话
            </label>
            <input title="请填写" class="baseInp w_input  w408" data-required="2" name="server_tel" type="text" autofocus value="<?=$conf['M_tel']?>">
            <span class="ui-form-other ui-form-explain">请认真填写</span>
        </div>
        <div class="ui-form-item">
            <label class="ui-label">
                <span class="ui-form-required"></span>地址
             </label>
			<!-- check -->
            <!--<input title="请填写" class="w_input  w408" data-required="2" name="add_domain" type="text" autofocus value="<?=$conf['M_addr']?>">-->
			<textarea name="add_domain" data-required="2" class="a_input  w408" id="textarea" cols="45" value="" rows="5"><?=$conf['M_addr']?></textarea>
            <span class="domain_url_title">请填写您的联系信息及网站备案信息。如需换行，请自行回车或者添加</span>
        </div>
        <!--thumb image-->
        <div class="ui-form-item" style="position: relative;">
            <input type="hidden" name="web_logo" id="thumb_imgLogo" 
            value="<?if($conf['M_logo1']) echo $conf['M_logo1']?>"/>
            <label class="ui-label">
                <span class="ui-form-required">*</span>网站 Logo
            </label>
           
            <div class="uploadImg_a">
                <!--<p class="title">重新上传缩略图：</p>-->
                <input type="file" name="logo" id="imgupLogo" class="uploadFile"/>
                <input type="button" id="BtnUploadLogo" value="上传" class="ui-button ui-button-swhite"/>
                <p class="ui-form-explain tigMsg">点击上传JPG或GIF等格式的图片,建议图片尺寸：宽280像素，高60像素</p>
                <p id="waitingUploadLogo" class="ui-form-other_a"></p>
            </div>
            <p class="ui-form-explain msgTip">默认将使用商户提供的缩略图作为页面展示的图片</p>
			 <a id="lnk_prvLogo"  title="" href="">
                <img style="width:280px;height:68px;" src="<?echo ($conf['M_logo1']) ? $conf['M_logo1']:'http://www.12301.cc/images/index_logo.png'?>" id="previewLogo" />
            </a>
        </div>
        <!--thumb image-->
        
        <!--thumb image-->
        <div class="ui-form-item" style="position: relative;">
            <input type="hidden" name="web_banner" id="thumb_imgbanner" value="<?if($conf['M_banner']) echo $conf['M_banner']?>"/>
            <label class="ui-label">
                banner
            </label>
            
            <div class="uploadImg_a">
               <!-- <p class="title">重新上传缩略图：</p>-->
                <input type="file" name="banner" id="imgupbanner" class="uploadFile"/>
                <input type="button" id="BtnUploadbanner" value="上传" class="ui-button ui-button-swhite"/>
                <p class="ui-form-explain msgLoading">点击上传JPG或GIF等格式的图片,建议图片尺寸：宽1500像素，高350像素</p>
                <p id="waitingUploadbanner" class="ui-form-other_a"></p>
            </div>
            <p class="ui-form-explain msgLoad">默认将使用商户提供的缩略图作为页面展示的图片</p>
			<a id="lnk_prvbanner"  title="" href="">
                <img style="width:500px;height:auto;" src="<?echo ($conf['M_banner']) ? $conf['M_banner']:'http://www.12301.cc/images/new_login/login_banner_b.jpg'?>" id="previewbanner" />
            </a>
        </div>

     
     
        <div class="ui-form-item_a">
        <button class="ui-button ui-button-lblue w_btn" id="saveConfig" data-wrap="ticketBox" type="button">保存</button>
        </div>
    </fieldset>
	<div class="conmb_ma">
			<img src="http://qr.liantu.com/api.php?text=http://<?=$_SESSION['account']?>.12301.cc/wx/html/productlist.html" class="touxiang">
			<p>店铺二维码</p>
			<!--http://100014.12301.cc/wx/html/productlist.html-->
			<p><a class="link" href="?act=download2">下载二维码图片</a></p>
		</div>
    </form>
    </div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){ 
    $("#saveConfig").click(function(){
        $(".uploadFile").removeAttr("name");
        $("form#mainForm").attr("action","domainConf.php").submit();
    });
    //图片上传
    $("#BtnUploadLogo").bind('click',function(){
        $("#upload_mth").val("logo");
        if(!$("input#imgupLogo").val().length) return;
        $("form#mainForm").attr("action","call/uploadLogoImage.php").submit();
        $("#waitingUploadLogo").html('<img src="images/loading.gif" alt="图片上传中"/>图片上传中..').show();
    });
    //图片上传
    $("#BtnUploadbanner").bind('click',function(){
        $("#upload_mth").val("banner");
        if(!$("input#imgupbanner").val().length) return;
        $("form#mainForm").attr("action","call/uploadLogoImage.php").submit();domainConf.php
        $("#waitingUploadbanner").html('<img src="images/loading.gif" alt="图片上传中"/>图片上传中..').show();
    });
});
</script>
<ul id="mainAreas"></ul>
<iframe src="about:blank" style="display:none;"  name="hideFrame" frameborder="10"></iframe>
<!-- 核心文件 -->
<script type="text/javascript" src="js/easydialog.min.js" ></script>

    <link rel="stylesheet" type="text/css" href="http://www.12301.cc/css/common/reset_style.css"/>
     <link rel="stylesheet" href="http://www.12301.cc/css/new/domainConf.css"/>


<?include 'common/footer.html';?>